import xhrAdapter from '../xhr/index.js';

export default function dispatch(config) {
  return xhrAdapter(config).then(
    response => {
      console.log('请求成功');
      return response;
    },
    reason => {
      console.log('请求失败');
      return Promise.reject(reason);
    }
  );
}
